home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tpb4_src.zip / MSGREAD.PAS < prev    next >
Pascal/Delphi Source File  |  1988-09-13  |  24KB  |  702 lines

  1. { TPBoard 4.2 Copyright (c) 1987,88 by Jon Schneider & Rick Petersen  
  2.   Portions Copyright (c) 1986,87 by Steve Fox and Les Archambault  
  3.   
  4.   Last modified  ::  5-27-88 8:11 pm 
  5. }
  6.  
  7. {$R-}                             {Range checking off}
  8. {$B-}                             {Boolean complete evaluation off}
  9. {$S-}                             {Stack checking off}
  10. {$I+}                             {I/O checking on}
  11. {$N-}                             {No numeric coprocessor}
  12.  
  13. Unit MsgRead;
  14.  
  15. Interface
  16.  
  17. Uses
  18.   TPCrt, TPDOS, Globals, TAccess, Core1, Core2,
  19.   MsgMove, MsgEntr, MsgMisc, EditUsr1, EditUsr2;
  20.   
  21.   
  22. procedure mesg_header_list(loc             : Integer;
  23.                            var first_line,
  24.                            last_line       : Integer;
  25.                            var Fr_fn       : FirstName;
  26.                            var Fr_ln       : LastName);
  27.                            
  28. procedure mesg_quick_scan;
  29.  
  30. procedure mesg_summary;
  31.  
  32. procedure mesg_read;
  33.  
  34.  
  35.   {==========================================================================}
  36.   
  37.   
  38. Implementation
  39.  
  40.  
  41.   procedure SysopCmds(var update : Boolean);
  42.   
  43.   var
  44.     ch, drive       : Char;
  45.     work            : DosFileName;
  46.     This            : AreaPtr;
  47.     temp_name       : DosFileName;
  48.     
  49.   begin
  50.     repeat
  51.       WriteLn(Com);
  52.       st := prompt('Sysop Message command <D><H><I><M><N><P><R><Q><?>', 80, 'ES?');
  53.       if Length(st) = 1 then
  54.         ch := st[1]
  55.       else
  56.         ch := '?';
  57.       case ch of
  58.         'D' :
  59.           begin
  60.             summ_rec.status := deleted;
  61.             summ_rec.num_prev := 0;
  62.           end;
  63.         'H' :
  64.           summ_rec.status := restricted;
  65.         'I' :
  66.           summ_rec.status := private;
  67.         'M' :
  68.           begin
  69.             abort := False;
  70.             repeat
  71.               This := AreaBase;
  72.               work := prompt('Message Area ', 12, 'ES?M');
  73.               if work = '?' then
  74.                 begin
  75.                   WriteLn(Com, 'Available Message Areas:');
  76.                   WriteLn(Com);
  77.                   while (not brk) and (This <> nil) do
  78.                     begin
  79.                       if This^.AreaName[1] <> '-' then
  80.                         WriteLn(Com, This^.AreaName)
  81.                       else
  82.                         begin
  83.                           temp_name := This^.AreaName;
  84.                           Delete(temp_name, 1, 1);
  85.                           WriteLn(Com, temp_name)
  86.                         end;
  87.                       This := This^.next;
  88.                     end;
  89.                 end;
  90.               This := AreaBase;   {set up to find name match}
  91.               while (This <> nil) and (This^.AreaName <> work) and
  92.               (Pos(work, This^.AreaName) <> 2) do
  93.                 This := This^.next;
  94.             until (work = This^.AreaName) or (brk) or (not Online)
  95.             or (Pos(work, This^.AreaName) = 2);
  96.             
  97.             if (This^.AreaName[1] = '-') or (This^.AreaName = 'NETMAIL') then
  98.               begin
  99.                 drive := DefaultDrive;
  100.                 work := drive+':\TEMP.MSG';
  101.                 record_msg(work);
  102.                 make_fido_message(This^.AreaName, work, summ_rec.user_from,
  103.                   summ_rec.user_to, summ_rec.subject,
  104.                   False, '', 0, 0, False);
  105.               end
  106.             else
  107.               summ_rec.Area := This^.Area;
  108.           end;
  109.         'N' :
  110.           begin
  111.             if summ_rec.num_prev = 0 then
  112.               summ_rec.num_prev := 255
  113.             else
  114.               summ_rec.num_prev := 0;
  115.             if summ_rec.num_prev = 255 then
  116.               Write(Com, 'NOT ');
  117.             WriteLn(Com, 'subject to purge.');
  118.           end;
  119.         'P' :
  120.           summ_rec.status := public;
  121.         'R' :
  122.           summ_rec.status := Seen
  123.       else
  124.         WriteLn(Com, '<D>elete, <H>ide, pr<I>vate, <M>ove, <N>o Purge, <P>ublic, <R>ead, <Q>uit')
  125.       end
  126.     until (not Online) or (ch in ['D', 'H', 'I', 'M', 'N', 'P', 'R', 'Q']);
  127.     update := True;
  128.   end;                            {SysopCmds}
  129.   
  130.   
  131.   
  132.   function mesg_start(pr : StrPr)     : Integer;
  133.     { Get starting message number from user }
  134.     
  135.   var
  136.     i, last         : Integer;
  137.     
  138.   begin
  139.     repeat
  140.       WriteLn(Com);
  141.       last := user_rec.lasthi;
  142.       i := strint(prompt(pr+' (last mesg you read is '+intstr(last, 1)+') '+' ['+intstr(msg_lo,
  143.         1)+'-'+intstr(msg_hi, 1)+']?', 5, 'E'));
  144.       if ((i < msg_lo) or (i > msg_hi)) and (i <> 0) then
  145.         WriteLn(Com, 'Invalid message number, try again.');
  146.     until ((i >= msg_lo) and (i <= msg_hi)) or (i = 0) or (not Online);
  147.     mesg_start := i
  148.   end;
  149.   
  150.   
  151.   
  152.   procedure mesg_header_list(loc             : Integer;
  153.                              var first_line,
  154.                              last_line       : Integer;
  155.                              var Fr_fn       : FirstName;
  156.                              var Fr_ln       : LastName);
  157.     { Display message header }
  158.     
  159.   var
  160.     to_fn           : FirstName;
  161.     to_ln           : LastName;
  162.     Str             : StrTAD;
  163.     temp_user_rec   : user_list;
  164.     This            : AreaPtr;
  165.     from_temp,
  166.     to_temp         : Str36;
  167.     
  168.   begin
  169.     Write(Com, yellow);
  170.     Seek(summ_file, loc);
  171.     Read(summ_file, summ_rec);
  172.     with summ_rec do
  173.       begin
  174.         if user_to = 0 then
  175.           begin
  176.             to_fn := 'ALL';
  177.             to_ln := ''
  178.           end
  179.         else if user_to = user_loc then
  180.           begin
  181.             to_fn := user_rec.fn;
  182.             to_ln := user_rec.ln
  183.           end
  184.         else
  185.           begin
  186.             if user_to <> -1 then
  187.               begin
  188.                 GetRec(DatF, user_to, temp_user_rec);
  189.                 to_fn := temp_user_rec.fn;
  190.                 to_ln := temp_user_rec.ln;
  191.               end
  192.             else
  193.               begin
  194.                 to_fn := 'Deleted';
  195.                 to_ln := 'User';
  196.               end;
  197.           end;
  198.         if user_from = user_loc then
  199.           begin
  200.             Fr_fn := user_rec.fn;
  201.             Fr_ln := user_rec.ln
  202.           end
  203.         else
  204.           begin
  205.             if user_from <> -1 then
  206.               begin
  207.                 GetRec(DatF, user_from, temp_user_rec);
  208.                 Fr_fn := temp_user_rec.fn;
  209.                 Fr_ln := temp_user_rec.ln;
  210.               end
  211.             else
  212.               begin
  213.                 Fr_fn := 'Deleted';
  214.                 Fr_ln := 'User';
  215.               end;
  216.           end;
  217.         Str := FormTAD(date);
  218.         This := AreaBase;
  219.         while (This <> nil) and (This^.Area <> Area) do
  220.           This := This^.next;
  221.         WriteLn(Com);
  222.         if num_prev = 255 then
  223.           Write(Com, '<P>');
  224.         case status of
  225.           deleted :
  226.             Write(Com, 'Deleted');
  227.           Seen :
  228.             Write(Com, 'Read');
  229.           private :
  230.             Write(Com, 'Private');
  231.           public :
  232.             Write(Com, 'Public');
  233.           restricted :
  234.             Write(Com, 'Restricted');
  235.         end;
  236.         WriteLn(Com, ' message # ', num, '    ', This^.AreaName, ' AREA ', '   Entered ', Str);
  237.         from_temp := Fr_fn+' '+Fr_ln;
  238.         {$V-}
  239.         caps_to_mixed(from_temp);
  240.         to_temp := to_fn+' '+to_ln;
  241.         caps_to_mixed(to_temp) {$V+} ;
  242.         WriteLn(Com, white, 'From: ', cyan, from_temp);
  243.         WriteLn(Com, white, '  To: ', cyan, to_temp);
  244.         WriteLn(Com, white, '  Re: ', cyan, subject, yellow);
  245.         if audit_on then
  246.           begin
  247.             SetSect(AudName);
  248.             WriteLn(AuditFile);
  249.             if num_prev = 255 then
  250.               Write(AuditFile, '<P>');
  251.             case status of
  252.               deleted :
  253.                 Write(AuditFile, 'Deleted');
  254.               Seen :
  255.                 Write(AuditFile, 'Read');
  256.               private :
  257.                 Write(AuditFile, 'Private');
  258.               public :
  259.                 Write(AuditFile, 'Public');
  260.               restricted :
  261.                 Write(AuditFile, 'Restricted');
  262.             end;
  263.             WriteLn(AuditFile, ' message # ', num, ' entered ', Str);
  264.             WriteLn(AuditFile, 'From: ', Fr_fn, ' ', Fr_ln);
  265.             WriteLn(AuditFile, '  To: ', to_fn, ' ', to_ln);
  266.             WriteLn(AuditFile, '  Re: ', subject);
  267.             SetSect(HomName);
  268.           end;
  269.         first_line := st_rec;
  270.         last_line := size
  271.       end
  272.       
  273.   end;                            {message header list}
  274.   
  275.   
  276.   
  277.   procedure mesg_quick_scan;
  278.     { Print abbreviated summary of messages }
  279.     
  280.   var
  281.     private         : Boolean;
  282.     sep             : Char;
  283.     num,
  284.     line_count      : Integer;
  285.     
  286.   begin
  287.     line_count := 0;
  288.     private := False;
  289.     num := mesg_start('Start');
  290.     if num <> 0 then
  291.       begin
  292.         MesgCurr := MesgBase;
  293.         while (MesgCurr <> nil) and (MesgCurr^.MesgNo < num) do
  294.           MesgCurr := MesgCurr^.next;
  295.         WriteLn(Com);
  296.         abort := False;
  297.         while (not brk) and (MesgCurr <> nil) do
  298.           begin
  299.             if (MesgCurr^.TypMsg = 1) or (MesgCurr^.TypMsg = 2) then
  300.               begin
  301.                 private := True;
  302.                 sep := '*'
  303.               end
  304.             else
  305.               sep := ':';
  306.             Seek(summ_file, MesgCurr^.SummLoc);
  307.             Read(summ_file, summ_rec);
  308.             WriteLn(Com, MesgCurr^.MesgNo, sep, ' ', summ_rec.subject);
  309.             MesgCurr := MesgCurr^.next;
  310.             if user_rec.lines <> 99 then
  311.               begin
  312.                 Inc(line_count);
  313.                 if line_count mod user_rec.lines = 0 then
  314.                   pause
  315.               end
  316.           end;
  317.         if private then
  318.           begin
  319.             WriteLn(Com);
  320.             WriteLn(Com, '"*" marks messages to or from you.')
  321.           end
  322.       end;
  323.   end;
  324.   
  325.   
  326.   
  327.   procedure mesg_summary;
  328.     { Message summary }
  329.     
  330.   var
  331.     num,
  332.     first_line,
  333.     last_line,
  334.     line_count      : Integer;
  335.     Fr_fn           : FirstName;
  336.     Fr_ln           : LastName;
  337.     
  338.   begin
  339.     line_count := 0;
  340.     abort := False;
  341.     num := mesg_start('Start');
  342.     if num <> 0 then
  343.       begin
  344.         MesgCurr := MesgBase;
  345.         while (MesgCurr <> nil) and (MesgCurr^.MesgNo < num) do
  346.           MesgCurr := MesgCurr^.next;
  347.         while (not brk) and (MesgCurr <> nil) do
  348.           begin
  349.             mesg_header_list(MesgCurr^.SummLoc, first_line, last_line, Fr_fn, Fr_ln);
  350.             MesgCurr := MesgCurr^.next;
  351.             if user_rec.lines <> 99 then
  352.               begin
  353.                 Inc(line_count);
  354.                 if line_count mod (user_rec.lines div 5) = 0 then
  355.                   pause
  356.               end
  357.           end
  358.       end;
  359.   end;
  360.   
  361.   
  362.   
  363.   procedure mesg_read;
  364.     { Read message }
  365.     
  366.   var
  367.     This            : MesgPtr;
  368.     ch, option      : Char;
  369.     pr_str,
  370.     Dirspec         : StrPr;
  371.     RefDrv          : Str3;
  372.     Fr_fn           : FirstName;
  373.     Fr_ln           : LastName;
  374.     update, skip,
  375.     backup, OK      : Boolean;
  376.     i, num,
  377.     first_line,
  378.     last_line,
  379.     line_count,
  380.     strt            : Integer;
  381.     RefFile,
  382.     RefSect         : DosFileName;
  383.     this_type       : Byte;
  384.     
  385.   begin
  386.     OK := True;
  387.     nonstop := False;
  388.     MesgCurr := MesgBase;
  389.     num := 0;
  390.     abort := False;
  391.     repeat
  392.       WriteLn(Com);
  393.       st := prompt('Read Search Option <A><F><T><N><S><Q> ', 80, 'ES?M');
  394.       if Length(st) = 1 then
  395.         option := st[1]
  396.       else
  397.         option := '?';
  398.       if option = '?' then
  399.         begin
  400.           WriteLn(Com, '<A>ll, <F>rom you, <T>o you <N>umeric, <S>ince your last call, <Q>uit')
  401.           ;
  402.           mult_cmds := False;
  403.           Cmd_Queue := '';
  404.         end;
  405.     until (not Online) or (option in ['A', 'F', 'T', 'N', 'S', 'Q']);
  406.     case option of
  407.       'A' :
  408.         if MesgBase <> nil then
  409.           num := MesgBase^.MesgNo;
  410.       'N' :
  411.         begin
  412.           num := mesg_start('Start'); {get starting number}
  413.           if num = 0 then OK := False;
  414.         end;
  415.       'F' :
  416.         begin
  417.           if msg_aut = 0 then
  418.             begin
  419.               OK := False;
  420.               WriteLn(Com, 'No Messages From You.');
  421.             end;
  422.         end;
  423.       'T' :
  424.         begin
  425.           if msg_ind = 0 then
  426.             begin
  427.               OK := False;
  428.               WriteLn(Com, 'No Messages for you.');
  429.             end;
  430.         end;
  431.       'S' :
  432.         num := Succ(user_rec.lasthi);
  433.       'Q' :
  434.         OK := False;
  435.     end;
  436.     if ((num > 0) and (OK)) then
  437.       while (MesgCurr <> nil) and (MesgCurr^.MesgNo < num) do
  438.         MesgCurr := MesgCurr^.next;
  439.         
  440.     while (not brk) and (MesgCurr <> nil) and OK and Online do
  441.       begin
  442.         backup := False;
  443.         skip := False;
  444.         update := False;
  445.         if option = 'F' then
  446.           while (MesgCurr <> nil) and (MesgCurr^.TypMsg <> 2) do
  447.             MesgCurr := MesgCurr^.next;
  448.         if option = 'T' then
  449.           while (MesgCurr <> nil) and (MesgCurr^.TypMsg <> 1) do
  450.             MesgCurr := MesgCurr^.next;
  451.         if (MesgCurr <> nil) then
  452.           begin
  453.             if MesgCurr^.MesgNo > temp_hi_lmr then
  454.               temp_hi_lmr := MesgCurr^.MesgNo;
  455.             mesg_header_list(MesgCurr^.SummLoc, first_line, last_line, Fr_fn, Fr_ln);
  456.             line_count := 4;
  457.             if (not nonstop) then
  458.               begin
  459.                 repeat
  460.                   repeat
  461.                     WriteLn(Com);
  462.                     pr_str := white+intstr(time_left, 1)+'-'+yellow+'Read <Y><N><C><Q><P><R>';
  463.                     if user_rec.access >= 250 then
  464.                       pr_str := pr_str+'<X><E><V><S>';
  465.                     st := prompt(pr_str+cyan, 1, 'ESA?M');
  466.                     if Length(st) = 1 then
  467.                       ch := st[1]
  468.                     else
  469.                       ch := '?';
  470.                     if (user_rec.access < 250) and ((ch = 'X') or (ch = 'E')
  471.                       or (ch = 'S') or (ch = 'V'))
  472.                     then
  473.                       ch := '?';
  474.                     if ch = '?' then
  475.                       begin
  476.                         WriteLn(Com,
  477.                           '<Y>es, <N>o, <C>ontinuous, <Q>uit, <P>revious, <R>eply');
  478.                         if user_rec.access >= 250 then
  479.                           WriteLn(Com,
  480.                             '<X> Sysop Commands, <E>dit or <V>alidate caller, <S>ave to disk');
  481.                         mult_cmds := False;
  482.                         Cmd_Queue := '';
  483.                       end;
  484.                   until (not Online) or
  485.                   (ch in ['Y', 'N', 'C', 'Q', 'P', 'R', 'X', 'E', 'V', 'S']);
  486.                   case ch of
  487.                     'Q' :
  488.                       OK := False;
  489.                     'C' :
  490.                       nonstop := True;
  491.                     'N' :
  492.                       skip := True;
  493.                     'P' :
  494.                       backup := True;
  495.                     'R' :
  496.                       begin
  497.                         skip := True;
  498.                         if user_rec.access >= val_acc then
  499.                           mesg_enter('A')
  500.                         else
  501.                           WriteLn(Com, 'Replys not accepted until validation.');
  502.                       end;
  503.                     'S' :
  504.                       if user_rec.access >= 250 then
  505.                         begin
  506.                           record_msg('');
  507.                           skip := True;
  508.                         end;
  509.                     'X' :
  510.                       if user_rec.access >= 250 then
  511.                         begin
  512.                           SysopCmds(update);
  513.                           skip := True;
  514.                         end
  515.                       else
  516.                         OK := False;
  517.                     'E' :
  518.                       begin
  519.                         if user_rec.access >= 250 then
  520.                           edit_user(Fr_fn, Fr_ln, 0)
  521.                         else
  522.                           OK := False;
  523.                         mesg_header_list(MesgCurr^.SummLoc, first_line,
  524.                           last_line, Fr_fn, Fr_ln);
  525.                       end;
  526.                     'V' :
  527.                       begin
  528.                         if user_rec.access >= 250 then
  529.                           Validate_user(Fr_fn, Fr_ln)
  530.                         else
  531.                           OK := False;
  532.                         mesg_header_list(MesgCurr^.SummLoc, first_line,
  533.                           last_line, Fr_fn, Fr_ln);
  534.                       end;
  535.                   end;
  536.                 until ((ch <> 'E') and (ch <> 'V')) or (not Online);
  537.               end;                {not nonstop}
  538.             WriteLn(Com);
  539.             if (not skip) and (OK) and (not backup) then
  540.               begin
  541.                 check_time;
  542.                 i := 1;
  543.                 Seek(mesg_file, first_line);
  544.                 while (not brk) and (i <= last_line) and Online do
  545.                   begin
  546.                     Read(mesg_file, mesg_rec);
  547.                     strt := Pos('//', mesg_rec); { format: //section/filename/ }
  548.                     if (strt > 0) and (summ_rec.num_next > 0) then
  549.                       begin
  550.                         RefSect := '';
  551.                         RefFile := '';
  552.                         strt := strt+2; {offset}
  553.                         while (mesg_rec[strt] <> '/') and (strt <= Length(mesg_rec)) do
  554.                           begin
  555.                             RefSect := RefSect+Upcase(mesg_rec[strt]);
  556.                             Inc(strt);
  557.                           end;
  558.                         Inc(strt); {offset again}
  559.                         while (mesg_rec[strt] <> '/') and (strt <= Length(mesg_rec)) do
  560.                           begin
  561.                             RefFile := RefFile+Upcase(mesg_rec[strt]);
  562.                             Inc(strt);
  563.                           end;
  564.                         if (RefSect <> '') and (RefFile <> '') then
  565.                           begin
  566.                             FindSect(RefSect, RefDrv, OK);
  567.                             if OK then
  568.                               begin
  569.                                 if RefSect = 'SYSTEM' then
  570.                                   Dirspec := HomName
  571.                                 else
  572.                                   begin
  573.                                     Dirspec := RefDrv;
  574.                                     if (Length(HomName) > 3) and (Dirspec = HomDrv
  575.                                       ) then
  576.                                       begin
  577.                                         Dirspec := Dirspec+Copy(HomName, 4,
  578.                                           Length(HomName));
  579.                                         Dirspec := Dirspec+'\';
  580.                                       end;
  581.                                     Dirspec := Dirspec+RefSect;
  582.                                   end;
  583.                                 list_file(RefFile, Dirspec);
  584.                                 line_count := 1;
  585.                               end
  586.                             else
  587.                               OK := True; {preset for next msg. }
  588.                           end;
  589.                       end
  590.                     else
  591.                       WriteLn(Com, mesg_rec); {type message lines}
  592.                     Inc(i);
  593.                     if (user_rec.lines <> 99) and (not nonstop) then
  594.                       begin
  595.                         Inc(line_count);
  596.                         if line_count mod user_rec.lines = 0 then
  597.                           pause;
  598.                       end;
  599.                   end;            {print msg text}
  600.                 update := (summ_rec.user_to = user_loc) and ((summ_rec.status = private) or
  601.                   (summ_rec.status = public));
  602.                 if update then
  603.                   summ_rec.status := Seen;
  604.                 if ((summ_rec.user_from = user_loc) or (summ_rec.user_to = user_loc)) and (
  605.                   not nonstop) and
  606.                 (not backup) and (summ_rec.status <> deleted) then
  607.                   begin
  608.                     i := 0;
  609.                     WriteLn(Com);
  610.                     pr_str := 'DELETE this message';
  611.                     if (summ_rec.user_to = user_loc) then
  612.                       if ask(white+'Reply to Message'+cyan, 'N') then
  613.                         begin
  614.                           i := MesgCurr^.SummLoc;
  615.                           mesg_enter('A');
  616.                           pr_str := 'DELETE original message';
  617.                         end;
  618.                     WriteLn(Com);
  619.                     if ask(white+pr_str+cyan, 'N') then
  620.                       begin
  621.                         if ask(white+'Are you sure'+cyan, 'N') then
  622.                           begin
  623.                             if i > 0 then
  624.                               begin
  625.                                 Seek(summ_file, i);
  626.                                 Read(summ_file, summ_rec);
  627.                               end;
  628.                             summ_rec.status := deleted;
  629.                             update := True;
  630.                             MesgCurr := MesgCurr^.next;
  631.                             WriteLn(Com, 'Message deleted.');
  632.                           end
  633.                         else
  634.                           begin
  635.                             WriteLn(Com, 'Message retained.');
  636.                             MesgCurr := MesgCurr^.next;
  637.                           end;
  638.                       end
  639.                     else
  640.                       begin
  641.                         WriteLn(Com, 'Message retained.');
  642.                         MesgCurr := MesgCurr^.next
  643.                       end;
  644.                   end
  645.                 else
  646.                   MesgCurr := MesgCurr^.next;
  647.               end;                {skip, backup & OK}
  648.             if update then
  649.               begin
  650.                 Seek(summ_file, Pred(FilePos(summ_file)));
  651.                 Write(summ_file, summ_rec)
  652.               end;
  653.             if (skip) and (Online) then
  654.               MesgCurr := MesgCurr^.next;
  655.             WriteLn(Com);
  656.             if (backup) then
  657.               begin
  658.                 backup := False;
  659.                 if (MesgCurr <> MesgBase) then
  660.                   begin
  661.                     This := MesgCurr;
  662.                     MesgCurr := MesgBase; {find previous record}
  663.                     MesgPrev := MesgBase;
  664.                     if option in ['F', 'T'] then
  665.                       begin
  666.                         if option = 'F' then
  667.                           this_type := 2
  668.                         else
  669.                           this_type := 1;
  670.                         while (MesgCurr <> nil) and (MesgCurr^.Next <> This) do
  671.                           begin
  672.                             if MesgCurr^.TypMsg = this_type then
  673.                               MesgPrev := MesgCurr;
  674.                             MesgCurr := MesgCurr^.next;
  675.                           end;
  676.                         if MesgCurr^.TypMsg = this_type then
  677.                           MesgPrev := MesgCurr;
  678.                         MesgCurr := MesgPrev;
  679.                       end
  680.                     else
  681.                       begin
  682.                         while MesgCurr^.next <> This do
  683.                           MesgCurr := MesgCurr^.next;
  684.                       end;
  685.                   end;            {backup}
  686.               end;
  687.               
  688.               
  689.           end;                    {if mesgcurr<>nil}
  690.       end;                        {print msg and header}
  691.     if (not OK) then
  692.       begin
  693.         mult_cmds := False;
  694.         Cmd_Queue := '';
  695.       end;
  696.     nonstop := False;
  697.   end;                            {read messages}
  698.   
  699.   
  700. end.                              { of MSGREAD.PAS}
  701. 
  702.